package com.ruoyi.project.dict.lishi.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.dict.lishi.domain.CizuLishi;
import com.ruoyi.project.dict.lishi.mapper.CizuLishiMapper;
import com.ruoyi.project.dict.lishi.service.ICizuLishiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 历史解释Service业务层处理
 *
 * @author shixiangwen
 * @date 2021-04-08
 */
@Service
@DataSource(DataSourceType.DICT)
public class CizuLishiServiceImpl implements ICizuLishiService {

    @Autowired
    private CizuLishiMapper cizuLishiMapper;

    /**
     * 查询历史解释
     *
     * @param id 历史解释ID
     * @return 历史解释
     */
    @Override
    public CizuLishi selectCizuLishiById(Long id) {
        return cizuLishiMapper.selectCizuLishiById(id);
    }

    /**
     * 查询历史解释列表
     *
     * @param cizuLishi 历史解释
     * @return 历史解释
     */
    @Override
    public List<CizuLishi> selectCizuLishiList(CizuLishi cizuLishi) {
        return cizuLishiMapper.selectCizuLishiList(cizuLishi);
    }

    /**
     * 新增历史解释
     *
     * @param cizuLishi 历史解释
     * @return 结果
     */
    @Override
    public int insertCizuLishi(CizuLishi cizuLishi) {
        return cizuLishiMapper.insertCizuLishi(cizuLishi);
    }

    /**
     * 修改历史解释
     *
     * @param cizuLishi 历史解释
     * @return 结果
     */
    @Override
    public int updateCizuLishi(CizuLishi cizuLishi) {
        return cizuLishiMapper.updateCizuLishi(cizuLishi);
    }

    /**
     * 删除历史解释对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCizuLishiByIds(String ids) {
        return cizuLishiMapper.deleteCizuLishiByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除历史解释信息
     *
     * @param id 历史解释ID
     * @return 结果
     */
    @Override
    public int deleteCizuLishiById(Long id) {
        return cizuLishiMapper.deleteCizuLishiById(id);
    }
}
